package org.groovymud.shell.security.loginsteps;

import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;


public class LoginStepManager {
	private List<LoginStep> steps;

    public void setSteps(List<LoginStep> steps){
        this.steps = steps;
    }
    public List<LoginStep> getSteps(){
        return steps;
    }
    /**
	 * @return the firstStep
	 */
	public LoginStep getFirstStep() {
		return steps.get(0);
	}

    public LoginStep getNextStep(LoginStep loginStep) {
        final int index = steps.indexOf(loginStep) + 1;
        return index < steps.size() ? steps.get(index) : null;
    }

    public LoginStep getPreviousStep(LoginStep loginStep) {
        return steps.get(steps.indexOf(loginStep)-1);
    }
}
